package fastwave.cloud.demo.fastwave.biz.publisher.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
* <p>Title: MsgLog</p>
* @author: dwLiu
* @date: 2020/4/9 23:00
*/

/**
 * 消息投递日志
 */
@Data
@TableName(value = "msg_log")
public class MsgLog implements Serializable {
    public static final String COL_MSG_ID = "msg_id";
    public static final String COL_MSG = "msg";
    public static final String COL_EXCHANGE = "exchange";
    public static final String COL_ROUTING_KEY = "routing_key";
    public static final String COL_STATUS = "status";
    public static final String COL_TRY_COUNT = "try_count";
    public static final String COL_NEXT_TRY_TIME = "next_try_time";
    public static final String COL_CREATE_TIME = "create_time";
    public static final String COL_UPDATE_TIME = "update_time";
    /**
     * 消息唯一标识
     */
    @TableId(value = "msg_id", type = IdType.INPUT)
    private String msgId;

    /**
     * 消息体，JSON格式化
     */
    @TableField(value = "msg")
    private String msg;

    /**
     * 交换机
     */
    @TableField(value = "exchange")
    private String exchange;

    /**
     * 路由键
     */
    @TableField(value = "routing_key")
    private String routingKey;

    /**
     * 状态：0投递中 1投递成功 2投递失败 3已消费
     */
    @TableField(value = "status")
    private Integer status;

    /**
     * 重试次数
     */
    @TableField(value = "try_count")
    private Integer tryCount;

    /**
     * 下一次重试时间
     */
    @TableField(value = "next_try_time")
    private Date nextTryTime;

    /**
     * 创建时间
     */
    @TableField(value = "create_time")
    private Date createTime;

    /**
     * 更新时间
     */
    @TableField(value = "update_time")
    private Date updateTime;

    private static final long serialVersionUID = 1L;
}